Skip to content

fix(dav): Stop sending reminders for deleted calendar events#59145

Draft
joshtrichards wants to merge 2 commits intomasterfrom
jtr/fix-caldav-deleted-reminders-exclude
Draft

fix(dav): Stop sending reminders for deleted calendar events#59145
joshtrichards wants to merge 2 commits intomasterfrom
jtr/fix-caldav-deleted-reminders-exclude

Conversation

@joshtrichards
Copy link
Member

Summary

Notifications were still being sent for calendar events that had been deleted (moved to the trashbin).

Changes

  • Bug fix: Added co.deleted_at IS NULL to the calendarobjects join condition so trashed objects are excluded from reminder processing
    • Reviewer note: this is the main change - involving lines 53-55 (mapping to former line 44).
  • Other:
    • Removed unnecessary GROUP BY
      • The query joins on primary keys with no aggregate functions, so duplicate rows are not possible
    • Added $stmt->free() to both query methods to release database cursors
    • Code cleanup:
      • Removed redundant docblocks
      • Fixed typos
      • Extracted column list for readability
      • Misc formatting

Only true changes: lines 53-55 (former line 43) and the dropping of the groupBy (former line 46).

TODO

  • ...

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

The getRemindersToProcess() query joined calendarobjects without filtering out soft-deleted (trashed) objects. This caused reminders to continue firing for events the user had already deleted, since deletion moves objects to the trashbin rather than removing them from the calendarobjects table.

Add a deleted_at IS NULL condition to the calendarobjects join so
trashed objects are excluded from reminder processing.

Additionally:
- Remove unnecessary GROUP BY (joins are on primary keys with no aggregate functions, so no duplicate rows are possible)
- Add $stmt->free() to release database cursors after fetching
- Clean up redundant docblocks and fix typos
- Extract column list for readability

Fixes: #53497

Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards joshtrichards added bug feature: caldav Related to CalDAV internals labels Mar 21, 2026
Signed-off-by: Josh <josh.t.richards@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug feature: caldav Related to CalDAV internals

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Notifications still sent for deleted event

1 participant